package com.nova.scenic.projectlibs.util.fragment;


import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;

import java.util.ArrayList;

/**
 * 
 * @author scenic
 */
@SuppressLint("NewApi")
public interface FragmentOperator{
	
	public void switchFragmentByAttached(Class<? extends BaseFragment> current, Class<? extends BaseFragment> to);
	public void switchFragmentByAttached(Class<? extends BaseFragment> current, Class<? extends BaseFragment> to, Bundle bundle);
	public void switchFragmentByAttached(Class<? extends BaseFragment> current, Class<? extends BaseFragment> to, Bundle bundle,
										 int animationEnter, int animationExit
	);

    public void switchByHideAndAddWithStack(Fragment current,
											Class<? extends BaseFragment> to, Bundle bundle);

	public void replaceFragment(Class<? extends BaseFragment> current,
								Class<? extends BaseFragment> target,
								boolean add,
								Bundle bundle,
								int enter,
								int exit,
								int popEnter,
								int popExit
	);

	public void replaceFragment(Class<? extends BaseFragment> current,
								Class<? extends BaseFragment> target,
								boolean add,
								Bundle bundle
	);

	public void pop();
	
	public void init(Activity activity, Object... objects);
	
	public void release();

    public ArrayList<Fragment> getFragmentList();

    public Fragment getCurrentFragmentFilterDialogFragment();

	public BaseFragment getCurrentFragment();

    public void setCurrentFragment(BaseFragment fragment);

	public BaseFragment getLastFragment();
	
	public boolean executeBackup();
				 
	public class FragmentHelper {
        public static FragmentOperator newFragmentOperator(){
            return new SystemFragment();
        }
		public static FragmentOperator getFragmentOperator(){
			return SystemFragment.getInstance();
		}
		
		public static FragmentOperator getFragmentOperator(android.support.v4.app.FragmentManager activity){
			return null;
		}
	}
	
	
}
